<%@ include file = "/common/ini.jsp"%> 
<%@ include file = "/common/_log4j.jsp"%>
<%@ include file = "/js/_js_for_radio.jsp"%> 
<%
    String rootUrl = ControllerURL + "?serviceURL=sysframe.user.FindUsersService";  //根节点点击的Url
%>
<%
        String fromWhere = "ORG";
        if(session.getAttribute("fromWhere") != null)
        {
                fromWhere = (String)session.getAttribute("fromWhere");
                session.setAttribute("fromWhere",null);
        }
%>
<script>
    function changeView(serviceName,value)
    {
        window.location.href = "<%= ControllerURL%>?serviceURL=" + serviceName + "&fromWhere=" + value;
    }
</script>
<form name="form1">
    <table >
        <tr>
            <td  style="font-size:12px;font-weight: bold;">
                <input type="radio" name="fromWhere" value='ORG' onclick = "changeView('sysframe.user.FindUsersForTreeViewWithOrgRootService',this.value)">按机构　<input type="radio" name="fromWhere" value='ROLE' onclick = "changeView('sysframe.user.FindUsersForTreeViewWithRoleRootService',this.value)">按角色
            </td>
        </tr>
    </table>
</form>
<script>
        this.checkFormRadioByValue(form1.fromWhere,"<%= fromWhere%>");
</script>
<script>
    // 点击非节点触发的的事件
    function onclickNode(modelId,modelType)
    {
        if(modelType == "Org") // 根据节点类型来做不同的事情
        {
            changepage("<%= rootUrl%>&orgId=" + modelId);
            return;
        }
        if(modelType == "Role") // 根据节点类型来做不同的事情
        {
            changepage("<%= rootUrl%>&roleId=" + modelId);
            return;
        }
        if(modelType == "Post") // 根据节点类型来做不同的事情
        {
            changepage("<%= rootUrl%>&postId=" + modelId);
            return;
        }
        // 其他类型节点,同上面的if(

        // 未知节点，报错
        alert("未知节点类型 " + modelType);
    }

</script>
<%@ include file="/common/Tree/xtreeframe.jsp" %>
